#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int upper = 0, lower = 0, digit = 0, space = 0, other = 0;
	char arr[100];
	int i = 0;
	while (scanf("%c", &arr[i]) != EOF) {
		i++;
	}
	//for (i; i < 5; i++) {
		//scanf("%c", &arr[i]);
	//}
	for (int j = 0; j < i; j++) {
		if (arr[j] >= 'A' && arr[j] <= 'Z') {
			upper++;
		}
		else if (arr[j] >= 'a' && arr[j] <= 'z') {
			lower++;
		}
		else if (arr[j] >= '0' && arr[j] <= '9') {
			digit++;
		}
		else if (arr[j] == ' ') {
			space++;
		}
		else {
			other++;
		}
	}
	printf("%d %d %d %d %d", upper, lower, digit, space, other);

	return 0;
}